package com.cherish.pattern.delegate.simple;

import java.util.HashMap;
import java.util.Map;

/**
 * @Classname Leader
 * @Date 2019/4/7 22:01
 * @Author admin
 * @Description TODO
 */
public class Leader implements Employ {

    private Map<String, Employ> target = new HashMap<>();

    public Leader() {
        target.put("加密", new EmployA());
        target.put("登陆", new EmployB());
    }

    @Override
    public void doing(String command) {
        this.target.get(command).doing(command);
    }
}
